package com.ordertracker.service;

/**
 * Created by IntelliJ IDEA.
 * User: Andrey
 * Date: 15.01.13
 * Time: 1:27
 * To change this template use File | Settings | File Templates.
 */
public enum ActionType {
    NONE(""),
    ADD("add"),
    UPDATE("update"),
    GET("get"),
    DELETE("delete"),
    GET_ALL_LIST("get_all_list"),
    GET_BY_CRITERIA("get_by_criteria")
    ;

    private String name;

    private ActionType(String name) {
        this.name = name;
    }
    public String getName() {
        return name;
    }

    public static ActionType byName(String name) {
        for (ActionType val : ActionType.values()) {
            if (name.equals(val.getName())) {
                return val;
            }
        }
        return NONE;
    }
}
